package com.ranjiaqi.testannotation;

import org.junit.Test;

import java.util.Arrays;

/**
 * @ClassName TestMain
 * @Description TODO
 * @Author hp
 * @Date 2021/7/5 19:39
 * @Version 1.0
 **/
public class TestMain {

    @Test
    @Book(name = "小崔说法",price = 250,author = {""})
    public  void bookStore() throws Exception{
        Book book = TestMain.class.getMethod("bookStore").getAnnotation(Book.class);
        String name = book.name();
        int price = book.price();
        String[] authors = book.author();
        System.out.println(name);
        System.out.println(price);
        System.out.println(Arrays.toString(authors));
    }
}
